<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>render (Spec::Rails::Example::ViewExampleGroup)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File ..\..\vendor\plugins\rspec_on_rails/lib/spec/rails/example/view_example_group.rb, line 97</span>
        <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
          <span class="ruby-identifier">options</span> = <span class="ruby-constant">Hash</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">last</span> <span class="ruby-value">? </span><span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">:</span> {}
          <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:template</span>] = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span>

          <span class="ruby-identifier">set_base_view_path</span>(<span class="ruby-identifier">options</span>)
          <span class="ruby-identifier">add_helpers</span>(<span class="ruby-identifier">options</span>)

          <span class="ruby-identifier">assigns</span>[<span class="ruby-identifier">:action_name</span>] = <span class="ruby-ivar">@action_name</span>

          <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">path_parameters</span> = {
          <span class="ruby-identifier">:controller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">derived_controller_name</span>(<span class="ruby-identifier">options</span>),
          <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">derived_action_name</span>(<span class="ruby-identifier">options</span>)
          }

          <span class="ruby-identifier">defaults</span> = { <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span> }
          <span class="ruby-identifier">options</span> = <span class="ruby-identifier">defaults</span>.<span class="ruby-identifier">merge</span> <span class="ruby-identifier">options</span>

          <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">instance_variable_set</span> <span class="ruby-identifier">:@params</span>, <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">parameters</span>

          <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">send</span> <span class="ruby-identifier">:initialize_current_url</span>

          <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-node">%{
            def controller_path
              &quot;#{derived_controller_name(options)}&quot;
            end

            def controller_name
              &quot;#{derived_controller_name(options).split('/').last}&quot;
            end
          }</span>

          <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">send</span> <span class="ruby-identifier">:forget_variables_added_to_assigns</span>
          <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">send</span> <span class="ruby-identifier">:render</span>, <span class="ruby-identifier">options</span>
          <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">send</span> <span class="ruby-identifier">:process_cleanup</span>
        <span class="ruby-keyword kw">end</span></pre>
</body>
</html>